$(function(){
	
	var vm = new Vue({
		el:'#allWeal',
		data:{
			//优惠券福利
			wealData:testData.myWeal,
		},
		methods:{
			
			//收放优惠券详情
			controlRuler:function(e){
				var node = e.currentTarget.children;
				if(node[1].className.indexOf('active') < 0){
					//展开
					node[0].className = 'flex-full ruler animate';
					node[1].className = 'btn animate active';
				}else{
					//收起
					node[0].className = 'flex-full ruler animate dm-wrap';
					node[1].className = 'btn animate';
				};
			},
			
			//选择当前优惠券（确认订单模块）
			selCur:function(e){
				var target = e.currentTarget;
				$('.weal-box').removeClass('on');
				if(target.parentElement.className.indexOf('on') < 0){
					target.parentElement.className = 'weal-box on';
				};
				closeSubMain($('#selWeal'));
			},
		},
		//渲染完初始数据后执行
		mounted:function(){
			pullSwiper('#allWeal',true,true);
		}
	});
	
});


//下拉刷新
function refresh(pull){
	pull.innerHTML='刷新完成';
};

//上拉加载
function reload(pull){
	pull.innerHTML='已加载全部数据';
};
